<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><table id="top_location_line" width="100%"><table id="top_location_line" width="100%"><tr width="100%"><td><a href="http://www.urchin.com"><img border="0" src="../images/google_sm.gif" width="135" height="41"></a></td><td width="100%"><span id="top_line" style="width: 100%; float: left; clear: both; border-bottom: 1px solid #CCC;"><span id="top_title" style="float: left; margin-top: 10px;"><b>Help Center</b></span></td></tr></table>
<div id="page" lang="en" dir="ltr">
<div dir="ltr" id="content" lang="en">
<p class="line867"><strong>SOAP .NET Example 3: Getting a list of tables for a profile and the supported dimensions/metrics</strong> <p class="line862">(Return to main article: <a href="Samples_for_.NET_(SOAP)_v1.html">Samples for .NET (SOAP) v1</a>) <p class="line874">1. To use the types from the generated class without specifying the namespace, include the namespace as follows: <p class="line867"><pre>using SampleCode.com.google.DataAPI.ReportService;
</pre><p class="line874">2. Specify login and profile: <p class="line867"><pre>private const string login = "YOUR_LOGIN";
private const string password = "YOUR_PASSWORD";
private const int profileId = 16;
</pre><p class="line862">3. Define a service connection for the ReportService: <p class="line867"><pre>reportservice reportService = new reportservice();
</pre><p class="line874">4. Set up parameters and execute request: <p class="line867"><pre>Table[] tables = reportService.getTableList(login, password, profileId);
</pre><p class="line874">5. Display the information about retrieved datamaps: <p class="line867"><pre>    foreach (Table table in tables)
    {
        Console.WriteLine("Table id is \"" + table.tableId + "\", ");
        // Display the table dimensions.
        Console.WriteLine("dimensions are:");
        foreach (string dimension in table.dimensions)
                Console.WriteLine(" \t\"" + dimension + "\", ");
        // Display the table metrics.
        Console.WriteLine("metrics are:");
        foreach (string metric in table.metrics)
                Console.WriteLine("\t\"" + metric + "\", ");
    }
</pre><p class="line874">Complete sample code for this example is available in the ReportServiceGetStorageListSOAP.cs file. <p class="line862">(Return to main article: <a href="Samples_for_.NET_(SOAP)_v1.html">Samples for .NET (SOAP) v1</a>) </div><div id="pagebottom"></div>
</div>


<div id="footer" style="clear: both; margin: 0; padding: 0; border-bottom:1px solid #CCC;"></div><div id="copyright" style="font-size: 70%; text-align: center;">&copy;2010 Google</div>
</body></html>